
 
 D C . d e s t r o y ( b o o l K e e p I n t e r n a l C o n t e n t ) 
 
 
 
 D e s c r i p t i o n :   D e s t r o y s   t h e   c u r r e n t   D C   o b j e c t . 
 
 
 
 R e t u r n s :   B o o l e a n :   T r u e   i f   s u c c e s s f u l ,   f a l s e   o t h e r w i s e . 
 
 
 
 N o t e :   I f   b o o l K e e p I n t e r n a l C o n t e n t   i s   f a l s e   o r   u n d e f i n e d ,   o r   i f   t h e   D C   o b j e c t   i s   c l o s e d ,   d e s t r o y   w i l l   c l e a n   a n d   r e m o v e   a l l   i n t e r n a l l y   s t o r e d   D O M   n o d e s   a s s o c i a t e d   w i t h   t h e   D C   o b j e c t .   I f   b o o l K e e p I n t e r n a l C o n t e n t   i s   t r u e   a n d   t h e   D C   o b j e c t   r e m a i n s   o p e n ,   a l l   d i s p l a y e d   c o n t e n t   w i t h i n   t h e   D C   o b j e c t   w i l l   b e   p r e s e r v e d   a t   i t s   c u r r e n t   l o c a t i o n   i n   t h e   D O M   b e f o r e   t h e   a s s o c i a t e d   D C   o b j e c t   i s   d e s t r o y e d . 
 
 
 
 I f   a   f u n c t i o n   i s   d e c l a r e d   f o r   D C . b e f o r e D e s t r o y ( ) ,   t h i s   h a n d l e r   w i l l   a u t o m a t i c a l l y   b e   e x e c u t e d   b e f o r e   t h e   d e s t r o y   p r o c e s s   i s   p e r f o r m e d . 
 
 
 
 E x a m p l e : 
 
 
 
 D C . b e f o r e D e s t r o y   =   f u n c t i o n ( D C )   { 
 
     / /   D o   s o m e t h i n g   b e f o r e   t h e   D C   o b j e c t   i s   d e s t r o y e d . 
 
 } ; 
 
 
 
 / /   D e s t r o y   t h e   D C   o b j e c t . 
 
 D C . d e s t r o y ( ) ; 
 
 